<template>
    <div class="main_box" style="padding:10px">
        <div class="add_wrap">
            <el-form label-width="200px">
                <div class="tit">
                    <h2>基础信息</h2>
                    <el-button type="success" plain size="small" icon="fa fa-mail-forward" @click="returnList">返回
                    </el-button>
                </div>
                <el-row>
                    <el-form-item label="姓名:">
                        <span>{{ dataInfo.name }}</span>
                    </el-form-item>
                    <el-form-item label="性别:">
                        <span v-if="dataInfo.sex==1">男</span>
                        <span v-if="dataInfo.sex==2">女</span>
                    </el-form-item>
                    <el-form-item label="出生日期:">
                        <span>{{ dataInfo.birthday }}</span>
                    </el-form-item>
                    <el-form-item label="手机号:">
                        <span>{{ dataInfo.phone }}</span>
                    </el-form-item>
                    <el-form-item label="所属公司:">
                        <span>{{dataInfo.company}}</span>
                    </el-form-item>
                    <el-form-item label="所属部门:">
                        <span>{{ dataInfo.depart }}</span>
                    </el-form-item>
                    <el-form-item label="职位:">
                        <span>{{dataInfo.job}}</span>
                    </el-form-item>
                    <el-form-item label="紧急联系人:">
                        <span>{{ dataInfo.linkMan }}</span>
                    </el-form-item>
                    <el-form-item label="紧急联系电话:">
                        <span>{{ dataInfo.linkPhone }}</span>
                    </el-form-item>
                    <el-form-item label="荣誉等级:">
                        <span v-if="dataInfo.employLevel==1">黄金</span>
                        <span v-if="dataInfo.employLevel==2">钻石</span>
                        <span v-if="dataInfo.employLevel==3">特等</span>
                    </el-form-item>
                    <el-form-item label="家庭住址">
                        <span>{{dataInfo.address}}</span>
                    </el-form-item>
                    <el-form-item label="备注:">
                        <span>{{ dataInfo.remark }}</span>
                    </el-form-item>
                    <el-form-item label="创建人:">
                        <span>{{ dataInfo.createUserName }}</span>
                    </el-form-item>
                    <el-form-item label="创建时间:">
                        <span>{{ dataInfo.createDate }}</span>
                    </el-form-item>
                    <el-form-item label="修改人:">
                        <span>{{ dataInfo.modifyUserName }}</span>
                    </el-form-item>
                    <el-form-item label="修改时间:">
                        <span>{{ dataInfo.modifyDate }}</span>
                    </el-form-item>
                    
                </el-row>
            </el-form>

        </div>
    </div>
</template>
  
<script>
import EmployApi from '@/api/system/employ';
import DepartApi from "@/api/system/depart";
export default {
    data() {
        return {
            dataInfo: {},
            departList: [],
        };
    },
    computed: {

    },
    mounted() {
        this.getData()
    },
    methods: {
        getData() {
            EmployApi.getEmployInfo({ id: this.$route.query.id })
                .then(res => {
                    this.dataInfo = res.data
                })
            // EmployApi.getEmployInfo({id:this.$route.query.id})
            //     .then(res=>{
            //         this.dataInfo = res.data
            //     }),
        },
        // 获取所有的部门
        getDeparts() {
            DepartApi.listDepart()
                .then(res => {
                    this.departList = res.data;
                });
        },

        returnList(){
            this.$store.dispatch('delView', this.$route);
            this.$router.push({path: '/sys/employManagement'})
      }


    },
}
</script>
<style lang="scss" src="@/assets/css/views/add.scss" scope>

</style>
  